<div class="layuimini-container">
    <form id="app-form" class="layui-form layuimini-form">
        <div class="layui-form-item">
            <label class="layui-form-label">分类名</label>
            <div class="layui-input-block">
                <input type="radio" name="type" value="1" title="求购" class="field-type" checked>
                <input type="radio" name="type" value="2" title="供应" class="field-type">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">内容</label>
            <div class="layui-input-block">
                <input type="text" name="intro" lay-verify="required" lay-reqtext="内容不能为空" value=""
                    class="layui-input field-intro">
            </div>
        </div>

        <input type="hidden" class="field-id" name="id">
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>

<script>


    layui.use(['form', 'jquery', 'layer', 'func'], function () {
        var form = layui.form,
            layer = layui.layer,
            $ = layui.jquery;

        layui.func.assign({: json_encode($data) });   // 解析数据
    });
</script>
</body>

</html>